#import <QuartzCore/QuartzCore.h>

#import "viewcontroller.h"
#import "view.h"

@implementation ufoViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil//### now we start here, by yuedongweng, wonderful, we are greate!
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.view = [[ufoView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
    }
    return self;
}

//- (void)awakeFromNib ### before SDK 1.0, we usb nib, so we start here, now we did't need it
//{
//    animating = FALSE;
//    animationFrameInterval = 1;
//    self.displayLink = nil;
//}

- (void)dealloc
{
    [super dealloc];
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    //[self stopAnimation];
    
    [super viewWillDisappear:animated];
}

- (void)viewDidUnload
{
	[super viewDidUnload];
}

- (void)loadView
{
    //self.view.backgroundColor = [UIColor redColor];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc. that aren't in use.
}

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    if(0)
    {
       return UIInterfaceOrientationIsLandscape(toInterfaceOrientation); 
    }
    else
    {
        return UIInterfaceOrientationIsPortrait(toInterfaceOrientation);
    }
}

//iOS 6.0
#ifdef __IPHONE_6_0
- (BOOL) shouldAutorotate
{
    return YES;
}

- (NSUInteger) supportedInterfaceOrientations
{
    if(0)
    {
        return UIInterfaceOrientationMaskLandscape;
    }
    else
    {
        return UIInterfaceOrientationMaskPortrait;
    }
}
#endif  //__IPHONE_6_0

@end
